home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / HackAddict™ Magazine / HA 1-12 / HackAddict11.sit / HackAddict 11 ƒ / Files / Seti's UNIX Shell Scripts / enc.c < prev    next >
C/C++ Source or Header  |  1998-02-14  |  533b  |  27 lines

  1. /*This program will encrypt words in the one way UNIX style.
  2.  
  3. To compile: gcc enc.c -o enc
  4.  
  5.             -Seti
  6. */
  7.  
  8. #include <unistd.h>
  9. #include <stdio.h>
  10.  
  11. main()
  12. {
  13. char pass[30];
  14. char salt[3];
  15. char *pw;
  16.  
  17. printf("\nEnter the password to encrypt: ");
  18. scanf("%s", pass);
  19. printf("\nEnter any two letter/number salt, 2e  db  8c  etc...\n");
  20. printf("If salt is over two characters the password will not encrypt properly\n");
  21. printf("Enter salt: ");
  22. scanf("%s", salt);
  23. pw = crypt(pass, salt);
  24. printf("\nEncrypted password = %s\n\n", pw);
  25.  
  26. return 0;
  27. }